<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.roadmap.common.RdcResourceBundle"%>
<%@ page import= "com.roadmap.struts.action.ActionConst"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>

		<div id="basicInfoView" class="state-detail">
				<table class="profile-table">
					<tr>
						<th colspan="2" class="table-title">
							<span class="float-left">基本信息</span>
							<input id="aspirantId" type="hidden" value="<bean:write name='basicInfoForm' property='id'/>">
							
							<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
							<span class="float-right" style="margin-right:10px;"><a href="javascript:editBasicInfo();" title="编辑"><img src="res/images/logo/edit_16.png"/></a></span>
							</logic:present>
						</th>
					</tr>
					<tr>
						<td class="row-name">真实姓名</td>
						<td class="row-value"><span id="myname"><bean:write name="basicInfoForm" property="realName"/></span></td>
					</tr>
					<tr>
						<td class="row-name">性别</td>
						<td class="row-value"><span id="mysexdesc"><bean:write name="basicInfoForm" property="sexDesc"/></span></td>
					</tr>
					<tr>
						<td class="row-name">生日</td>
						<td class="row-value"><span id="mybirth"><bean:write format="yyyy-MM-dd" name="basicInfoForm" property="birthday"/></span></td>
					</tr>		
					<tr>
						<td class="row-name">婚姻状况</td>
						<td class="row-value"><span id="mylovedesc"><bean:write name="basicInfoForm" property="loveDesc"/></span></td>
					</tr>	
					<tr>
						<td class="row-name">居住地</td>
						<td class="row-value">
							<span id="mycountry"><bean:write name="basicInfoForm" property="country"/></span>
							<span id="myprovince"><bean:write name="basicInfoForm" property="province"/></span>
							<span id="mycity"><bean:write name="basicInfoForm" property="city"/></span>
						</td>
					</tr>			
				</table>
			</div>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="basicInfoEdit" class="state-detail">
				<table class="profile-table">
					<tr>
						<th colspan="2" class="table-title"><span>基本信息</span><span class="prompt-message" id="basicInfoMsg"></span></th>
					</tr>
					<tr>
						<td class="row-name">真实姓名</td>
						<td class="row-value"><input type="text" name="realName" class="input-text" maxlength="30"/></td>
					</tr>
					<tr>
						<td class="row-name">性别</td>
						<td class="row-value">
						 	<select class="select" id="sex" name="sex" tabindex="4">
							  <option value="<%=RdcResourceBundle.Sex_Desc_Female %>"><%=RdcResourceBundle.Sex_Desc_Female %></option>
							  <option value="<%=RdcResourceBundle.Sex_Desc_Male %>"><%=RdcResourceBundle.Sex_Desc_Male %></option> 
							</select> 
						</td>
					</tr>
					<tr>
						<td class="row-name">生日</td>
						<td class="row-value">
							<select class="select" id="year" name="birthYear" onchange="setDays();"></select>
							<select class="select" id="month" name="birthMonth" onchange="setDays();"></select>
							<select class="select" id="day" name="birthDay" ></select>
						</td>
					</tr>
					<tr>
						<td class="row-name">婚姻状况</td>
						<td class="row-value">
							<select class="select" name="loveType">
							<%
								StringBuffer strings = new StringBuffer();
								for (int i = 0; i < RdcResourceBundle.Love_Desc_Array.length; i++){
									strings.append("<option value='");
									strings.append(RdcResourceBundle.Love_Desc_Array[i]);
									strings.append("'");
									if(i == 0){
										strings.append(" selected");										
									}
									strings.append(">");
									strings.append(RdcResourceBundle.Love_Desc_Array[i]);
									strings.append("</option>");
									out.write(strings.toString());	
									out.newLine();								
									strings.delete(0, strings.length());
								}
							%>
								
							</select>
						</td>
					</tr>	
					<tr>
						<td class="row-name">居住地</td>
						<td class="row-value">
							<select class="select" name="country">	
								<option value="国家" selected="selected">国家</option>
								<option value="中国">中国</option>
							</select>
							<select class="select" name="province">
								<option value="省份" selected="selected">省份</option>
								<option value="北京">北京</option>
							</select>
							<select class="select" name="city">
							 	<option value="城市" selected>城市</option>	
								<option value="海淀">海淀</option>
							</select>
						</td>
					</tr>	
					
					<tr>
						<td class="row-name"></td>
						<td class="row-value">
							<input id="saveUser" type="button" class="confirmBtn" value="保存" onclick="saveBasicInfo();"/>
							<input type="button" class="cancelBtn" value="取消" onclick="showBlock('basicInfoEdit','basicInfoView');"/>
						</td>
					</tr>
				</table>
			</div>
			</logic:present>
			
			<div id="contactView" class="state-detail">	
				<table class="profile-table" >
					<tr>
						<th colspan="2" class="table-title"><span class="float-left">联系方式</span>
							<input id="contactId" type="hidden" value="<bean:write name='contactForm' property='id'/>">
							<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
							<span class="float-right" style="margin-right:10px;"><a href="javascript:editContact();" title="编辑"><img src="res/images/logo/edit_16.png"/></a></span>
							</logic:present>
						</th>
					</tr>
					<tr>
						<td class="row-name">电子邮件</td>
						<td class="row-value"><span id="mymail"><bean:write name="basicInfoForm" property="mail"/></span></td>
					</tr>
					<tr>
						<td class="row-name">其它常用邮箱</td>
						<td class="row-value"><span id="myothermail"><bean:write name="contactForm" property="otherMail"/></span></td>
					</tr>
					<tr>
						<td class="row-name">手机</td>
						<td class="row-value"><span id="myphone"><bean:write name="contactForm" property="phone"/></span></td>
					</tr>
					<tr>
						<td class="row-name">MSN</td>
						<td class="row-value"><span id="mymsn"><bean:write name="contactForm" property="MSN"/></span></td>
					</tr>
					<tr>
						<td class="row-name">QQ</td>
						<td class="row-value"><span id="myqq"><bean:write name="contactForm" property="QQ"/></span></td>
					</tr>				
				</table>
			</div>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="contactEdit" class="state-detail">	
				<table class="profile-table">
					<tr>
						<th colspan="2" class="table-title"><span>联系方式</span><span class="prompt-message" id="contactMsg"></span></th>
					</tr>
					<tr>
						<td class="row-name">电子邮件</td>
						<td class="row-value"><input type="text" class="input-text" name="mail" disabled size="40"  maxlength="50"/></td>
					</tr>
					<tr>
						<td class="row-name">其它常用邮箱</td>
						<td class="row-value"><input type="text" class="input-text" name="otherMail" size="40" maxlength="50"/></td>
					</tr>
					<tr>
						<td class="row-name">手机</td>
						<td class="row-value"><input type="text" class="input-text" name="phone" size="40" maxlength="11"/></td>
					</tr>
					<tr>
						<td class="row-name">MSN</td>
						<td class="row-value"><input type="text" class="input-text" name="MSN" size="40" maxlength="50"/></td>
					</tr>
					<tr>
						<td class="row-name">QQ</td>
						<td class="row-value"><input type="text" class="input-text" name="QQ" size="40" maxlength="11"/></td>
					</tr>		
					<tr>
						<td class="row-name"></td>
						<td class="row-value">
							<input id="saveContact" type="button" class="confirmBtn" value="保存" onclick="saveContactInfo();"/>
							<input type="button" class="cancelBtn" value="取消"  onclick="showBlock('contactEdit','contactView');"/>
						</td>
					</tr>			
				</table>
			</div>
			</logic:present>
			
			<div id="studentView" class="state-detail">	
				<table class="profile-table">
					<tr>
						<th colspan="2" class="table-title"><span class="float-left">学习</span>
							<input id="studentId" type="hidden" value="<bean:write name='studentForm' property='id'/>">
							<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
							<span class="float-right" style="margin-right:10px;"><a href="javascript:editStudent();" title="编辑"><img src="res/images/logo/edit_16.png"/></a></span>
							</logic:present>
						</th>
					</tr>	
					<tr>
					    <td class="row-name">起止时间</td>
						<td class="row-value"><span id="mystsartdate"><bean:write format="yyyy" name='studentForm' property='startDate'/></span>
							<span id="st_sepatator"><logic:notEmpty name='studentForm' property='startDate'>~</logic:notEmpty></span>
							<span id="mystenddate"><bean:write format="yyyy" name='studentForm' property='endDate'/></span>
						</td>
					</tr>								
					<tr>
						<td class="row-name">学校</td>
						<td class="row-value"><span id="myschool"><bean:write name='studentForm' property='school'/></span></td>
					</tr>	
					<tr>
						<td class="row-name">学历</td>
						<td class="row-value"><span id="myedulevel"><bean:write name='studentForm' property='eduDesc'/></span></td>
					</tr>
					<tr>
						<td class="row-name">有何感受</td>
						<td class="row-value"><span id="myschoolfeeling"><bean:write name='studentForm' property='feelDesc'/></span></td>
					</tr>									
				</table>
			</div>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="studentEdit" class="state-detail">	
				<table class="profile-table" >
					<tr>
						<th colspan="2" class="table-title"><span>学习</span><span class="prompt-message" id="studentMsg"></span></th>
					</tr>
					<tr>
						<td class="row-name">起止时间</td>
						<td class="row-value">
							<select id="ststartdate" class="select"></select><span>~</span><select id="stenddate" class="select"></select>							
						</td>
					</tr>	
					<tr>
						<td class="row-name">学校</td>
						<td class="row-value"><input type="text" class="input-text" name="school" size="40" maxlength="45"/></td>
					</tr>
					<tr>
						<td class="row-name">学历</td>
						<td class="row-value">
							<select class="select" name="edulevel">
							<%
								StringBuffer levels = new StringBuffer();
								for (int i = 0; i < RdcResourceBundle.Education_Level_Desc_Array.length; i++){
									levels.append("<option value='");
									levels.append(RdcResourceBundle.Education_Level_Desc_Array[i]);
									levels.append("'");
									if(i == 0){
										levels.append(" selected");										
									}
									levels.append(">");
									levels.append(RdcResourceBundle.Education_Level_Desc_Array[i]);
									levels.append("</option>");
									out.write(levels.toString());	
									out.newLine();								
									levels.delete(0, levels.length());
								}
							%>
							</select>
						</td>
					</tr>
					<tr>
						<td class="row-name">有何感受</td>
						<td class="row-value">
							<select class="select" name="schoolfeeling">
							<%
								StringBuffer feelings = new StringBuffer();
								for (int i = 0; i < RdcResourceBundle.Feeling_Desc_Array.length; i++){
									feelings.append("<option value='");
									feelings.append(RdcResourceBundle.Feeling_Desc_Array[i]);
									feelings.append("'");
									if(i == 0){
										feelings.append(" selected");										
									}
									feelings.append(">");
									feelings.append(RdcResourceBundle.Feeling_Desc_Array[i]);
									feelings.append("</option>");
									out.write(feelings.toString());	
									out.newLine();								
									feelings.delete(0, feelings.length());
								}
							%>
							</select>
						</td>
					</tr>							
					<tr>
						<td class="row-name"></td>
						<td class="row-value">
							<input id="saveStudy" type="button" class="confirmBtn" value="保存" onclick="saveStudyInfo();"/>
							<input type="button" class="cancelBtn" value="取消" onclick="showBlock('studentEdit','studentView');"/>
						</td>
					</tr>			
				</table>
			</div>
			</logic:present>
			
			<div id="businessView" class="state-detail">	
				<table class="profile-table">
					<tr>
						<th colspan="2" class="table-title"><span class="float-left">工作</span>
							<input id="careerId" type="hidden" value="<bean:write name='careerForm' property='id'/>">
							<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
							<span class="float-right" style="margin-right:10px;"><a href="javascript:editBusiness();" title="编辑"><img src="res/images/logo/edit_16.png"/></a></span>
							</logic:present>
						</th>
					</tr>	
					<tr>
						<td class="row-name">起止时间</td>
						<td class="row-value"><span id="mycrstartdate"><bean:write format="yyyy" name='careerForm' property='startDate'/></span>
							<span id="cr_sepatator"><logic:notEmpty name='careerForm' property='startDate'>~</logic:notEmpty></span>
							<span id="mycrenddate"><bean:write format="yyyy" name='careerForm' property='endDate'/></span>
						</td>
					</tr>									
					<tr>
						<td class="row-name">职业</td>
						<td class="row-value"><span id="mycareer"><bean:write name='careerForm' property='jobTitle'/></span></td>
					</tr>
					<tr>
						<td class="row-name">所在单位</td>
						<td class="row-value"><span id="myorganization"><bean:write name='careerForm' property='organization'/></span></td>
					</tr>
					<tr>
						<td class="row-name">有何感受</td>
						<td class="row-value"><span id="myjobfeeling"><bean:write name='careerForm' property='feelDesc'/></span></td>
					</tr>						
				</table>
			</div>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="businessEdit" class="state-detail">	
				<table class="profile-table" >
					<tr><th colspan="2" class="table-title"><span>工作</span><span class="prompt-message" id="businessMsg"></span></th></tr>
					<tr>
						<td class="row-name">起止时间</td>
						<td class="row-value">
							<select id="crstartdate" class="select"></select><span>~</span><select id="crenddate" class="select"></select>							
						</td>
					</tr>	
					
					<tr>
						<td class="row-name">职业</td>
						<td class="row-value"><input type="text" class="input-text" name="jobTitle" size="40" maxlength="30"/></td>
					</tr>
					<tr>
						<td class="row-name">所在单位</td>
						<td class="row-value"><input type="text" class="input-text" name="organization" size="40" maxlength="80"/></td>
					</tr>	
					<tr>
						<td class="row-name">有何感受</td>
						<td class="row-value">
							<select class="select" name="jobfeeling">
								<%
									StringBuffer careerFeeling = new StringBuffer();
									for (int i = 0; i < RdcResourceBundle.Feeling_Desc_Array.length; i++){
										careerFeeling.append("<option value='");
										careerFeeling.append(RdcResourceBundle.Feeling_Desc_Array[i]);
										careerFeeling.append("'");
										if(i == 0){
											careerFeeling.append(" selected");										
										}
										careerFeeling.append(">");
										careerFeeling.append(RdcResourceBundle.Feeling_Desc_Array[i]);
										careerFeeling.append("</option>");
										out.write(careerFeeling.toString());	
										out.newLine();								
										careerFeeling.delete(0, careerFeeling.length());
									}
								%>
							</select>
						</td>
					</tr>
					<tr>
						<td class="row-name"></td>
						<td class="row-value">
							<input type="button" class="confirmBtn" value="保存" onclick="saveBizInfo();" name="saveCareer"/>
							<input type="button" class="cancelBtn" value="取消" onclick="showBlock('businessEdit','businessView');"/>
						</td>
					</tr>			
				</table>
			</div>
			</logic:present>
